/**
 * Copyright ©2012-2018 HopeHaiyang Corporation, All Rights Reserved
 * http://www.wuhanhope.com
 */
package hope.platform.data.dao;

import hope.platform.data.domain.HopeException;
import org.springframework.data.mongodb.repository.MongoRepository;

import java.util.Date;
import java.util.List;

/**
 * class info
 *
 * @author hujia
 *         Create at 2018/7/20 14:36
 */
public interface HopeExceptionRepository extends MongoRepository<HopeException, String> {

    List<HopeException> findAll();

    List<HopeException> findByGmtCreateBetween(Date beginTime, Date endTime);

    List<HopeException> findByExceptionType(String exceptionType);

    List<HopeException> findByExceptionTypeAndSerialNumber(
            String exceptionType, String serialNumber);

    List<HopeException> findByExceptionTypeAndSerialNumberAndDataName(
            String exception, String serialNumber, String DataName);

    List<HopeException> findBySerialNumber(String serialNumber);

    List<HopeException> findBySerialNumberAndDataNameAndGmtCreateBetween(
            String serialNumber, String dataName, Date beginTime, Date endTime);

    List<HopeException> findBySerialNumberAndDataNameAndGmtCreateBetweenOrderByGmtCreateDesc(
            String serialNumber, String dataName, Date beginTime, Date endTime);

    long countBySerialNumberAndDataNameAndGmtCreateBetween(String serialNumber,
                                                           String dataName,
                                                           Date beginTime,
                                                           Date endTime);

}
